package top.ranzhang.mapper;

import ch.qos.logback.core.joran.sanity.Pair;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import top.ranzhang.bean.entity.Course;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import top.ranzhang.bean.vo.AdminCourseVO;

import java.time.LocalDateTime;
import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ran
 * @since 2025-04-14
 */
@Mapper
public interface CourseMapper extends BaseMapper<Course> {

    void insertChild(Integer id, List<Integer> childId);

    void insertCoash(Integer id, List<Integer> coashId);

    @Delete("delete from child_and_course where course_id = #{id}")
    void ChildRemove(Integer id);

    @Delete("delete from coash_and_course where course_id = #{id}")
    void CoashRemove(Integer id);

    AdminCourseVO ToGetById(Integer id);

    List<AdminCourseVO> TOGetListBatch(@Param("ranges") List<Map<String, Object>> ranges);
//    List<AdminCourseVO> TOGetListNow(LocalDateTime startTime, LocalDateTime endTime);
    
}
